/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#ifdef __cplusplus
extern "C" {
#endif


#ifndef __FLGR_DATA_TOOLS_PSTACK_H 
#define __FLGR_DATA_TOOLS_PSTACK_H 

#include <flgrCoreDll.h>
#include <flgrCoreTypes.h>
#include <flgrCoreErrors.h>
#include <flgrCoreVector.h>

/*!
 * \addtogroup group_fulguro_datatools_pstack
 * @{
 */  

  typedef struct FLGR_StackLink FLGR_StackLink; 
  
  struct FLGR_StackLink { 
    FLGR_StackLink *lower;
    int x;
    int y;
    int z;
  }; 
   

  typedef struct FLGR_Stack FLGR_Stack; 

  struct FLGR_Stack{
    int size;
    FLGR_StackLink *top;   
    void *label;
    FLGR_Stack *next;
    FLGR_Stack *previous;
  };



  EXPORT_LIB void flgr_stack_init(FLGR_Stack *stack);

  EXPORT_LIB int flgr_stack_push(FLGR_Stack *stack, int x, int y, int z);
  EXPORT_LIB int flgr_stack_pop(FLGR_Stack *stack, int *x, int *y, int *z);

  EXPORT_LIB void flgr_stack_flush(FLGR_Stack *stack);
  
  EXPORT_LIB FLGR_Stack* flgr_stack_get_next(FLGR_Stack *stack);
  EXPORT_LIB FLGR_Stack* flgr_stack_get_previous(FLGR_Stack *stack);
 
  EXPORT_LIB int flgr_stack_get_size(FLGR_Stack *stack);


  //!@}

#endif 

#ifdef __cplusplus
}
#endif
